﻿<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>中南大学自动化学院模型管理平台</title>
    <link rel="icon" type="image/x-icon" href="./favicon.ico" />
    <script type="text/javascript">
      // 检测浏览器版本
      (function () {
        var version = ieVer();
        if (version < 9) {
          location.href = "./static/version.html";
        }
        function ieVer() {
          var userAgent = navigator.userAgent;
          var isOpera = userAgent.indexOf("Opera") > -1;
          var isIE =
            userAgent.indexOf("compatible") > -1 &&
            userAgent.indexOf("MSIE") > -1 &&
            !isOpera;
          if (isIE) {
            var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
            reIE.test(userAgent);
            var IEVersion = parseFloat(RegExp["$1"]);
            return Math.floor(IEVersion);
          }

          return Infinity;
        }
      })();
    </script>
    <link type="text/css" rel="stylesheet" href="./css/reset.css" />

    <script>
      var now = new Date().getTime();
      document.write(
        '<link href="./css/index2.css?v=' +
          now +
          '" rel="stylesheet" type="text/css"/>' +
          '<link href="./css/reg.css?v=' +
          now +
          '" rel="stylesheet" type="text/css"/>'
      );
    </script>
    <script type="text/javascript" src="./js/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" src="./js/vue.min.2.5.13.js"></script>
    <script src="./js/login.js"></script>
    <script src="./js/utils.js"></script>
    <script src="./js/jquery.zxxbox.3.0-min.js"></script>
    <script src="./js/jquery.placeholder.js"></script>
  </head>
  <body style="background-color: #f9f9f9;">
    <div id="_app">
      <div id="top">
        <div class="wid">
          <div id="logo">
            <a href="./index.html"></a>
              <h1>
                <a href="./index.html" style="font-size: 18px;"
                  >自动化学院模型管理平台</a
                >
              </h1>
          </div>
          <div id="nav">
            <ul id="app">
              <li>
                <img src="./images/yishoulu.png" alt="" class="left" />
                <div class="right">
                  <span class="num">{{statistics.projectSum}}</span
                  ><span class="name">已收录数据</span>
                </div>
              </li>
              <li>
                <img src="./images/shuju.png" alt="" class="left" />
                <div class="right">
                  <span class="num">{{statistics.todaySum}}</span
                  ><span class="name">今日收录</span>
                </div>
              </li>
              <li>
                <img src="./images/chaxun.png" alt="" class="left" />
                <div class="right">
                  <span class="num">{{statistics.browseSum}}</span
                  ><span class="name">总浏览量</span>
                </div>
              </li>
            </ul>
          </div>
          <div id="logoright">
            <div id="nologinbox">
              <a href="./login.html" class="on" rel="nofollow">登录</a
              ><span>|</span><a href="./reg.html" rel="nofollow">注册</a>
            </div>
          </div>
          <div class="clear"></div>
        </div>
      </div>
      <div class="wid wid2">
        <div id="regright" class="loginright">
          <h1>欢迎注册</h1>
          <form>
            <div class="formline">
                <div class="labelright">
                  <input
                    type="text"
                    name="email"
                    class="roundinput"
                    id="email"
                    placeholder="请输入您的邮箱"
                  />
                </div>
                <div class="flhint" id="emailhint"></div>
              </div>
            <div class="formline" id="verifycodeline">
              <div class="labelright">
                <input
                  type="text"
                  name="verifycode"
                  class="roundinput"
                  id="verifycode"
                  placeholder="请输入邮箱验证码"
                />
                <input
                  id="btncode"
                  type="button"
                  value="发送验证码"
                  class="btn"
                  onclick="sendMessage()"
                />
              </div>

              <div class="flhint" id="verifycodehint"></div>
            </div>
            <div class="formline">
              <div class="labelright">
                <input
                  type="password"
                  name="password"
                  class="roundinput"
                  id="password"
                  placeholder="请输入密码 8位以上"
                />
              </div>
              <div class="flhint" id="passwordhint"></div>
            </div>
            <div class="formline">
                <div class="labelright">
                  <input
                    type="text"
                    name="mobile"
                    class="roundinput"
                    id="mobile"
                    placeholder="请输入您的手机号码"
                  />
                </div>
                <div class="flhint" id="mobilehint"></div>
              </div>
           
            <div class="formline">
              <input
                type="hidden"
                name="hashcode"
                id="hashcode"
                value="BTADZVc2DCFcaFo+ACAEMltkBzIBLgo3BTdVeVM/DGYLNlMwUTMEM1BlWzoCP1Vj"
              />
              <input type="hidden" name="fromurl" id="fromurl" value="/" />
              <input
                type="button"
                name="rb"
                class="btn"
                id="regbtn"
                value="马上注册"
              />
            </div>
            <div class="formline mcenter" id="regrbotline">
              已有帐号？<a href="./login.html" class="bluea">立即登录</a>
            </div>
          </form>
        </div>
        <div class="clearfix"></div>
      </div>
      <script type="text/javascript">
        var InterValObj;
        var count = 300;
        var curCount;

        function sendMessage() {
          if ($("#email").parent().hasClass("has-error")) return false;
          curCount = count;
          $("#btncode").attr("disabled", "true");
          $("#btncode").val("重新发送(" + curCount + ")");
          InterValObj = window.setInterval(SetRemainTime, 1000);
          $.get(
            "/ProjectApi/GetEmailCode?email=" +
            // "http://39.106.120.139/ProjectApi/GetEmailCode?email=" +
              $("#email").val(),
            function (data) {
              if ( JSON.parse(data).msg == 1) {
                $.zxxbox.remind("验证码已发送，请您至邮箱查收", null, {
                  title: "提示",
                  drag: true,
                  bg: false,
                  delay: 3000,
                });
              } else if (data.status == 2) {
                window.location.reload();
              } else {
                $.zxxbox.remind(data.msg|| '未知', null, {
                  title: "提示",
                  drag: true,
                  bg: false,
                  delay: 3000,
                });
              }
            }
          );
        }

        function SetRemainTime() {
          if (curCount == 0) {
            window.clearInterval(InterValObj);
            $("#btncode").removeAttr("disabled");
            $("#btncode").val("发送验证码");
          } else {
            curCount--;
            $("#btncode").val("重新发送(" + curCount + ")");
          }
        }
      </script>
      <script type="text/javascript">
        function isEmail(val) {
          var reg = /^([a-zA-Z0-9]+[_|_|.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|_|.]?)*[a-zA-Z0-9]+.[a-zA-Z]{2,4}$/;
          return reg.test(val);
        }
        function isMobile(val) {
          var reg = /^1[3456789]\d{9}$/;
          return reg.test(val);
        }
        function isPassword(val) {
          var reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[^]{8,16}$/;
          return reg.test(val);
        }

        $("#email")
          .on("focus", function () {
            $(this).parent().removeClass("has-error");
            $("#emailhint").addClass("red").html("");
          })
          .on("blur", function () {
            var email = $.trim($(this).val());
            if (email == "") {
              $(this).parent().removeClass("has-error");
            } else if (!isEmail(email)) {
              $(this).parent().addClass("has-error");
              $("#emailhint").addClass("red").html("Email有误");
            } else {
            //   $.getJSON("/my/reg?act=checkemail&email=" + email, function (
            //     data
            //   ) {
            //     if (data.status == 0) {
            //       $("#emailhint").removeClass("red").html("");
            //     } else if (data.status == 2) {
            //       window.location.reload();
            //     } else {
            //       $("#email").parent().addClass("has-error");
            //       $("#emailhint").addClass("red").html(data.msg);
            //     }
            //   });
            }
          });
        $("#mobile")
          .on("focus", function () {
            $(this).parent().removeClass("has-error");
            $("#mobilehint").addClass("red").html("");
          })
          .on("blur", function () {
            var mobile = $.trim($(this).val());
            var hashcode = $.trim($("#hashcode").val());
            if (!isMobile(mobile)) {
              $(this).parent().addClass("has-error");
              $("#mobilehint").addClass("red").html("手机号有误");
            } else {
            //   $.getJSON(
            //     "/my/reg?act=checkmobile&mobile=" +
            //       mobile +
            //       "&hashcode=" +
            //       hashcode,
            //     function (data) {
            //       if (data.status == 0) {
            //         $("#mobilehint").removeClass("red").html("");
            //       } else if (data.status == 2) {
            //         window.location.reload();
            //       } else {
            //         $("#mobile").parent().addClass("has-error");
            //         $("#mobilehint").addClass("red").html(data.msg);
            //       }
            //     }
            //   );
            }
          });
        $("#password")
          .on("focus", function () {
            $(this).parent().removeClass("has-error");
            $("#passwordhint").html("");
          })
          .on("blur", function () {
            var password = $.trim($(this).val());
            if (password.length < 8) {
              $(this).parent().addClass("has-error");
              $("#passwordhint").html('<span class="red">8位以上</span>');
            } else if (!isPassword(password)) {
              $(this).parent().addClass("has-error");
              $("#passwordhint").html(
                '<span class="red" style="white-space: nowrap;">密码必须包含数字，大小写字母</span>'
              );
            } else {
              $("#passwordhint").html("");
            }
          });
        $("#regbtn").on("click", function () {
          if ($(".has-error").length > 0) return false;
          var email = $.trim($("#email").val());
          var password = $.trim($("#password").val());
          var mobile = $.trim($("#mobile").val());
          var verifycode = $.trim($("#verifycode").val());
          var hashcode = $.trim($("#hashcode").val());
          var agreement = $("input[name='agreement']:checked").val();
          if (mobile == "" || verifycode == "" || password == "")
            return false;
          $.post(
            "/ProjectApi/Register",
            // "http://39.106.120.139/ProjectApi/Register",
            {
              email: email,
              pwd: password,
              phone: mobile,
              code: verifycode,
            //   hashcode: hashcode,
            },
            function (data, status) {
                console.log(data)
              if (data && data.msg) {
            
                $.zxxbox.remind(data.msg, null, {
                  title: "提示",
                  drag: true,
                  bg: false,
                  delay: 3000,
                });
              }
            },
            "json"
          );
        });

        $("#checkboxgroup1").on("change", function () {
          if (!$("input:checkbox:checked").val()) {
            $(this).parent().addClass("has-error");
            $("#agreement").addClass("red").html("请勾选同意协议");
          } else {
            $(this).parent().removeClass("has-error");
            $("#agreement").removeClass("red").html("");
          }
        });

        $(":text,:password").placeholder();
      </script>
    </div>
    <div class="wid" id="foot2">
      <div class="wid2">
        <p class="clear mtop15 mcenter">© 2020-<script>
          var year = new Date().getFullYear();
          document.write(year);
        </script> <a href="http://soa.csu.edu.cn/" target="_blank" style="color:#999;display: inline;">中南大学自动化学院</a> 版权所有 <span>　<a href="http://www.beian.miit.gov.cn" target="_blank" style="color:#999;display: inline;">湘ICP备05005659号-1 </a>　湘教QS3-200505-000204
      </span></p>
      </div>
    </div>
  </body>
</html>
